#pragma once
#ifndef CGUIWINDOW_H_
#define CGUIWINDOW_H_

#include "GUI.h"
#include "LinkedList.h"

namespace GUI
{
	class CGUIWindow : public CGUIBase{
	private:
		LinkedList<CGUIBase>* m_pGUIList, *m_pGUIDrawList;
		Node<CGUIBase>* m_pGUIit;
		CGUIBase* m_pElement;
		CGUIBase* m_pFocusElement;
		LPCSTR m_Title;
		bool m_bMovable;
		POINT m_mouseStart;
		UINT m_numOfElements;
	public:
		
		CGUIWindow(GUI_PARAMS* params, GUI_COLORS* _colors, GUI_SPRITES* _sprites, bool _movable, LPCSTR _title);
		~CGUIWindow();

		virtual bool WndProc( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam );
		virtual bool HandleKeyboard( UINT uMsg, WPARAM wParam, LPARAM lParam );
		virtual bool HandleMouse( UINT uMsg, WPARAM wParam, LPARAM lParam );

		virtual bool RequestFocus();
		virtual bool CanHaveFocus();
		virtual void OnFocusIn();
		virtual void OnFocusOut();
		virtual void OnMouseEnter();
		virtual void OnMouseLeave();
		virtual void OnHotkey();

		bool FocusNext();
		bool SetFocusElement(CGUIBase* _element);
		CGUIBase* GetFocusElement(){ return m_pFocusElement; }

		virtual void Step();
		virtual void Draw();

		void Add(CGUIBase* _GUI);
	};
}

#endif